import "./style.scss";
import Uts from '@module/Uts'
export default function BreadCrumbs(props) {
    //定义全局变量 const [scope值，更新方法] = React.useState({初始化的值});
    const [currentDate, updateCurrentDate] = React.useState({
        selectName: ""
    });

    //生命周期 页面渲染完后再执行，每次刷新前也执行
    React.useEffect(() => {}, []);

    //更新视图数据 私有的方法前缀用_
    function _updateData(value) {
        console.log(value);
        let newValue = { ...currentDate, ...value };
        updateCurrentDate(newValue);
    }

    function itemClick(item,index) {
        if(props.tittleList) {
            if(item.canClick){
                $state.go({
                    stateName:item.path,
                    params:item.params
                })
            }
        }
    }
//"zen_il-bl zen_fs-12 zen_969696 rj_item"
    return (
        <div className="zen_h-72 zen_l-h-72 rj_breadCrumbs-wp">
            {props.tittleList.map((item, index) => {
                return (
                    <span
                        key={Math.random().toString()}
                        className={Uts.sc(['zen_fs-12 zen_969696 rj_item',item.canClick? 'zen_c rj_item1':''])}
                        onClick={() => {
                            itemClick(item,index);
                        }}
                    >
                        {item.name}
                    </span>
                );
            })}
        </div>
    );
}
